function handleKeyPress(event) {
  if (event.keyCode === 13 && !event.shiftKey) {
    event.preventDefault(); // 阻止默认的回车提交行为
    document.getElementById("myButton").click(); // 模拟按钮点击事件
  } else if (event.keyCode === 13 && event.shiftKey) {
    var textarea = document.getElementById("myTextarea");
    var currentPosition = textarea.selectionStart; // 获取光标位置
    var oldValue = textarea.value;
    var newValue = oldValue.substring(0, currentPosition) + "\n" +
                   oldValue.substring(currentPosition, oldValue.length);
    textarea.value = newValue; // 插入换行符
    textarea.setSelectionRange(currentPosition + 1, currentPosition + 1); // 重置光标位置
    event.preventDefault(); // 阻止默认的换行行为
  }
}
